<template>
    <div>
        BBBBB{{$attrs.www}}{{theme}}
        <button @click='fna'>改变a的内容</button>
        <c></c>
    </div>
</template>
<script>
// @ is an alias to /src
import vm from './bus'
import c from './c'
export default {
    name: 'bba',
    props:['name','qqq'],
    components:{c},
    data() {
        return {
        
        }
    },
    inject:['theme'],
    created() {
        vm.$on('changeB',this.fn)
    },
    methods: {
        fn(){
            console.log('这时组件B的一个方法',this)
        },
        fna(){
            console.log(vm)
            vm.$emit('changeA','b1','b2','b3')
        }
    },
    beforeDestroy() {
        vm.$off('changeB',this.fn)
    },
}
</script>
<style lang="less">

</style>